﻿@model SimpleTaskManager.Domain.Entities.Task

    <table class="tablesorter" id="taskTable">
<thead>
        <tr>
            <th>Name</th>
            <th>Leader</th>
            <th>Group</th>
@if(ViewBag.IsLeader){
            <th>Actions</th>
    }
        </tr>
</thead>
<tbody>
@foreach (var task in Model.SubTasks)
{
        <tr>
                <td>@Html.ActionLink(task.Name, "People", new { id = task.TaskID})</td>
                <td>@((task.Leader != null) ? task.Leader.LastName + ", " + task.Leader.FirstName : "-")</td>
                <td>@(task.Group.Count.ToString() + "/" + task.GroupSize.ToString()) | <a href="#" class="peoplelist ButtonLink" taskid=@task.TaskID>List</a></td>
                @if(ViewBag.IsLeader){<td><a href="#" class="AssignLink ButtonLink" taskid=@task.TaskID isSubTask="true">Manage assigned people</a></td> }
        </tr>
}
</tbody>
    </table>